package com.cwd.yg.dao;

import com.cwd.yg.pojo.Schedule;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Description：Schedule
 * @Author ：Cwd
 * @Date ：2022/2/7 14:40
 */
@Component
public interface ScheduleDao {

    @Select("select s.schedule_id,s.teacher_id,teacher_name,\n" +
            "\ts.lesson_id,lesson_name,\n" +
            "\ts.clazz_id,clazz_name,\n" +
            "\ts.classroom_id,clr.room_name,\n" +
            "\ts.time_id,week_number,day_number,time_range  \n" +
            "from schedule s\n" +
            "LEFT JOIN teacher t ON s.teacher_id = t.teacher_id\n" +
            "LEFT JOIN lesson l on s.lesson_id = l.lesson_id\n" +
            "LEFT JOIN clazz c ON s.clazz_id = c.clazz_id\n" +
            "LEFT JOIN classroom clr ON s.classroom_id = clr.room_id\n" +
            "LEFT JOIN time Tt on s.time_id = Tt.time_id")
    List<Schedule> queryAll();
}
